// OperatorOverloading.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include  <iostream.h>
class Location
{
public:
	Location( ){X = Y = 0;};
	Location(int i, int j) {X = i; Y = j;};
	Location(Location &p) {X = p.X; Y = p.Y;};
	Location & operator = (Location &p);
	int getX( ){return X;};
	int getY( ){return Y;};

private:
	int X, Y;
};

Location& Location ::operator = (Location &p)
{
	X = p.X;
	Y = p.Y;
	cout << "Assigment operator called.\n";
	return  *this;
}
void main( )
{
	Location a(7, 8);
	Location b;
	b = a;
	cout << b.getX( ) << "," << b.getY( ) << endl;
}